import React, { PureComponent, Fragment } from 'react';
import {
    Row,
    Card,
    Col,
    Button,
    Table,
    Divider,
    Popconfirm,
    Descriptions
} from 'antd';
import moment from 'moment';
import { connect } from 'dva';
import Ellipsis from '@/components/Ellipsis';

@connect()
class RepairDesc extends PureComponent {
    constructor(props) {
        super(props);

        this.record = this.props.location.state.record;
        // this.user_id = sessionStorage.getItem('user_id');
        // this.dispatch = this.props.dispatch;
    }

    componentDidMount = () => {

    };
    render() {
        return (
            <Fragment>
                <Card
                    title={
                        <span style={{ borderLeft: '4px solid #3CB371', paddingLeft: '10px' }}>
                            设施维修详情<Divider type="vertical" /><span>NO：{this.record.SortCode}</span>
                        </span>
                    }
                    style={{ margin: '10px'}}
                >
                    {/* <table border="1" cellspacing="0">
                        <tr>
                        <td>January</td>
                            <td>$100</td>
                        </tr>
                        <tr>
                            <td>January</td>
                            <td>$100</td>
                        </tr>
                    </table> */}
                    <Descriptions bordered column={4} style={{width:'70%' }}>
                        <Descriptions.Item label="设施名称" span={2}>{this.record.EquipmentName}</Descriptions.Item>
                        <Descriptions.Item label="报修时间" span={2}>{this.record.ApplyTime ? moment(this.record.ApplyTime).format('YYYY-MM-DD') : null}</Descriptions.Item>
                        <Descriptions.Item label="损坏原因" span={2}>
                        <Ellipsis length={40} tooltip>
                        {this.record.MaintainCause}
                        </Ellipsis>
                        </Descriptions.Item>
                        <Descriptions.Item label="维护内容" span={2}>
                        <Ellipsis length={40} tooltip>
                        {this.record.MaintainContent}
                        </Ellipsis>
                        </Descriptions.Item>
                        <Descriptions.Item label="拟处理意见" span={4}>
                        <Ellipsis length={40} tooltip>
                            {this.record.MaintainAdvice}
                        </Ellipsis>
                        </Descriptions.Item>
                        <Descriptions.Item label="维修单位" span={2}>
                            {this.record.MaintainGroup}
                        </Descriptions.Item>
                        <Descriptions.Item label="责任人" span={2}>
                            {this.record.MaintainPerson}
                        </Descriptions.Item>
                        <Descriptions.Item label="处理意见（期限要求）" span={4}>
                        <Ellipsis length={40} tooltip>
                           {this.record.ApproveAdvice}
                        </Ellipsis>
                        </Descriptions.Item>
                        <Descriptions.Item label="分管领导" span={2}>
                            {this.record.ApprovePerson}
                        </Descriptions.Item>
                        <Descriptions.Item label="审批时间" span={2}>
                            {this.record.ApproveTime ? moment(this.record.ApproveTime).format('YYYY-MM-DD') : null}
                        </Descriptions.Item>
                        <Descriptions.Item label="中间验收抽查内容" span={4}>
                        <Ellipsis length={40} tooltip>
                        {this.record.InspectContent}
                        </Ellipsis>
                        </Descriptions.Item>

                        <Descriptions.Item label="抽查人员" span={2}>
                            {this.record.InspectPerson}
                        </Descriptions.Item>
                        <Descriptions.Item label="抽查时间" span={2}>
                            {this.record.InspectTime ? moment(this.record.InspectTime).format('YYYY-MM-DD') : null}
                        </Descriptions.Item>

                        <Descriptions.Item label="完成情况" span={4}>
                        <Ellipsis length={40} tooltip>
                        {this.record.CompleteContent}
                        </Ellipsis>
                        </Descriptions.Item>
                        <Descriptions.Item label="备注" span={2}>
                        <Ellipsis length={40} tooltip>
                        {this.record.CompleteRemark}
                        </Ellipsis>
                        </Descriptions.Item>
                        <Descriptions.Item label="完成时间" span={2}>
                            {this.record.CompleteTime ? moment(this.record.CompleteTime).format('YYYY-MM-DD') : null}
                        </Descriptions.Item>

                        <Descriptions.Item label="监理单位验收意见" span={4}>
                        <Ellipsis length={40} tooltip>
                        {this.record.AcceptContent}
                        </Ellipsis>
                        </Descriptions.Item>

                        <Descriptions.Item label="验收人员" span={2}>
                            {this.record.AcceptPerson}
                        </Descriptions.Item>
                        <Descriptions.Item label="验收时间" span={2}>
                            {this.record.AcceptTime ? moment(this.record.AcceptTime).format('YYYY-MM-DD') : null}
                        </Descriptions.Item>

                        <Descriptions.Item label="管理部门检查情况" span={4}>
                        <Ellipsis length={40} tooltip>
                        {this.record.CheckContent}
                        </Ellipsis>
                        </Descriptions.Item>

                        <Descriptions.Item label="检查人员" span={2}>
                            {this.record.CheckPerson}
                        </Descriptions.Item>
                        <Descriptions.Item label="检查时间" span={2}>
                            {this.record.CheckTime ? moment(this.record.CheckTime).format('YYYY-MM-DD') : null}
                        </Descriptions.Item>
                    </Descriptions>
                </Card>
            </Fragment>
        );
    }
}

export default RepairDesc;
